package com.yungee.system.controller;

import com.yungee.system.entity.SysDept;
import com.yungee.system.service.SysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Optional;

/**
 * <p>
 * 部门表 前端控制器
 * </p>
 *
 * @author auto-generate
 * @since 2024-03-15
 */
@RestController
@RequestMapping("/system/sysDept")
public class SysDeptController {

    @Autowired
    private SysDeptService sysDeptService;
    @GetMapping("get")
    public String getSystemDept(Long id){
        SysDept sysDept = sysDeptService.selectDeptById(id);
        return Optional.ofNullable(sysDept).map(SysDept::getDeptName).orElse("未找到");
    }

}
